import Ember from 'ember';
import BaseBusiness from '../base-business';
import Pagination from '../pagination';
const {payStatus_processing,payType_apply,authenticate_succ,proportion_platform} = Constants;

/*
 * 角色管理
 * create by lmx
 */
export default BaseBusiness.extend(Pagination,{
  header_title:'角色及权限分配',
  model(){
    return {};
  },
  setupController: function(controller, model) {
    this._super(controller, model);
    this.doQuery();

  },
  doQuery: function() {
      var _self = this;
      //查询所有角色
      var params = this.pagiParamsSet();
      params.filter = {};
      var roles = this.findPaged('role', params, function(roleList) {
        console.log("roleList get",roleList);
        _self.getCurrentController().set("roleListPage", roleList);
        roleList.forEach(function(role){
          _self.getCurrentController().appendPrivInfoToRole(role);
        });

      });
      this.getCurrentController().set("roleList", roles);
  },

});
